﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.Security;
using System.Web.UI.WebControls;
using BusinessLayer;

namespace Design
{
    public partial class WebForm12 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        private void AssignRoles()
        {
            try
            {
                Roles.AddUserToRole(CreateUserWizard1.UserName, "customer");
            }
            catch (Exception ex)
            {

            }
        }

        protected void CreateUserWizard1_CreatedUser(object sender, EventArgs e)
        {
            AssignRoles();

            SignUp objadduser = new SignUp();

            objadduser.username = CreateUserWizard1.UserName.ToString();
            objadduser.password = CreateUserWizard1.Password.ToString();
            objadduser.email = CreateUserWizard1.Email.ToString();
            objadduser.type = "customer";
            objadduser.signup_date = DateTime.Now;

            objadduser.add_user();
        }
    }
}